package com.cuotoniu.lazybug.cotroller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.cuotoniu.lazybug.service.LoginService;

/**
 * Test Controller
 * 
 * @author HLJ
 *
 */
@Controller
@RequestMapping("/test")
public class HelloController {

	@Autowired
	private LoginService loginService;
	
	/**
	 * Test Hello
	 * @return
	 */
	@RequestMapping(value="/srv")
	public String index(HttpServletRequest req){
		boolean flag = loginService.checkLogin("diff_cc@163.com", "test2");
		System.out.println(flag);
		req.setAttribute("flag", flag+"");
		return "home";
	}
	
}
